CXX = g++
CXXFLAGS = -c -g
INCLUDES = -I/bwdata160/caosiyang/project/CorpusSearcher/lib/ -I/bwdata160/caosiyang/project/CorpusSearcher/ -I./
#LIBS = -L./lib -lclucene -L./ -lictclas -Wl,-rpath,./lib -lpthread
LIBS = -L./lib -L./ -Wl,-rpath,./lib -lictclas -lclucene -lpthread
OBJS = CorpusIndexer.o SentenceIndexer.o CollocationIndexer.o SegmentIndexer.o \
       CorpusSearcher.o SentenceSearcher.o CollocationSearcher.o SegmentSearcher.o \
       Task.o ThreadPool.o


ALL: create delete query server client

create: create.o $(OBJS)
	$(CXX) -o create create.o $(OBJS) $(LIBS)

delete: delete.o $(OBJS)
	$(CXX) -o delete delete.o $(OBJS) $(LIBS)

query: query.o $(OBJS)
	$(CXX) -o query query.o $(OBJS) $(LIBS)

server: server.o $(OBJS)
	$(CXX) -o server server.o $(OBJS) $(LIBS)

client: client.o
	$(CXX) -o client client.o

%.o: %.cpp
	$(CXX) -c -g $< $(INCLUDES)


.PHONY: clean
clean:
	-rm -rf create delete query server *.o
